A virtual (software) switch or host switch is a software component running on a host with links to one or more physical network interface controllers (pNICs) coupled to physical switches to provide network connectivity for I/O threads of applications running on the host. To provide link redundancy and bandwidth aggregation, NIC teaming, which includes and presents a plurality of pNICs as one virtual NIC teaming device to the I/O threads, has been used by the physical switches, operating systems, and hypervisors for many years. Here, NIC teaming configuration includes but is not limited to membership (e.g., which pNICs belong to the NIC team), load balancing (e.g., L2-L4 header based hashing, explicit fail-over, etc.), and protocol specifics (e.g., timeout threshold in Link Aggregation Control Protocol (LACP) state machine). These NIC teaming configuration can be changed anytime by users through a cluster management server.
Currently, when an NIC teaming device is up and running, changing its configuration requires holding a lock on the device, and the I/O threads that receive and transmit packets through the NIC teaming device need to check and acquire the lock. Specifically, changing the configuration of the NIC teaming device and handling activities of the I/O threads through the NIC teaming device are mutually exclusive—if the configuration of the NIC teaming device is changing, the I/O threads are blocked by the lock on the NIC teaming device until changes to its configuration is done; If the I/O threads are using the NIC teaming device, configuration thread to the NIC teaming device is blocked until the I/O threads relinquish the lock so the configuration thread can acquire the lock on the NIC teaming device. As such, the I/O threads need to acquire/release lock for every batch processing of the packets, even though changes to the configuration of the NIC teaming device happen very infrequently.
A BSD project called “Data Plane Development Kit” (DPDK) provides a set of libraries and procedures for fast packet processing. With DPDK and similar technologies, the pNIC drivers run in a polling mode (not excluding the possibility of a pushing mode, which is interrupt based), where I/O threads of the applications running on the host execute a run-to-complementation dispatch loop that cycles/iterates continuously through processing tasks (e.g., receiving, processing, and transmitting the packets to/from the pNICs) of a batch of packets during each iteration on multiple cores of the host concurrently. For high performance network processing, letting the applications acquire/release lock on the NIC teaming device to synchronize changes to its configuration is expensive.